//
//  BackgroundLayer.m
//  Template
//
//  Created by Hilary Muludiang on 7/2/12.
//  Copyright 2012 Versatile Systems, Inc. All rights reserved.
//

#import "BackgroundLayer.h"


@implementation BackgroundLayer
-(id)init {
	self = [super init];
	if (self != nil) { 
		
		CCSprite *backgroundImage;
		if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
			// Indicates game is running on iPad
			backgroundImage = [CCSprite spriteWithFile:@"backgroundiPad.png"];
		} else {
			backgroundImage = [CCSprite spriteWithFile:@"backgroundiPhone.png"];
		}
		CGSize screenSize = [[CCDirector sharedDirector] winSize];
		[backgroundImage setPosition:
		 CGPointMake(screenSize.width/2, screenSize.height/2)];
		[self addChild:backgroundImage z:0 tag:0]; 
	}
	return self;
}
@end
